import request  from '@/utils/request'

// 根据用户名查询问答  kind：普通用户：questioner；专家：expert
export function selectQuestionByUser(params) {
  return request({
      method: 'get',
      url: `questions/selectQuestionByKind/` + params.role,
  })
}

// 查询问答根据id
export function selectQuestionByUserId(params) {
  return request({
      method: 'get',
      url: `/question/selectId/{params.id}`,
      headers: {
          'Authorization': window.localStorage.token,
      },
      // data:params
  })
}

// 根据id修改
export function reviseQuestionByUserId(params) {
  return request({
      method: 'put',
      url: '/questions/updateQuestionById',
      data:params
  })
}

// 根据id删除
export function delQuestionByUserId(params) {
  return request({
      method: 'delete',
      url: `/questions/deleteQuestionById/${params.id}`,
  })
}

// 根据用户名查询预约  kind：普通用户：questioner；专家：expert
export function selectAppointByUser(params) {
  return request({
      method: 'get',
      url: `/reserves/selectByKind/${params.type}`,
  })
}

// 根据id修改预约
export function reviseAppointByUserId(params) {
  return request({
      method: 'put',
      url: '/reserves/updateById',
      data:params
  })
}

// 根据id删除预约
export function delAppointByUserId(params) {
  return request({
      method: 'delete',
      url: `/reserves/deleteById/${params.id}`,
  })
}